package com.cdut.hwadeefsc.mapper;

import com.cdut.hwadeefsc.entity.organizations;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author 1
 * @description 针对表【organizations(组织/部门表)】的数据库操作Mapper
 * @createDate 2025-09-15 15:08:59
 * @Entity com.cdut.hwadeefsc.entity.organizations
 */
public interface organizationsMapper extends BaseMapper<organizations> {
    @Select("SELECT * FROM organizations")
    List<organizations> get();

    // 移除createdAt和updatedAt字段的插入操作
    @Insert("INSERT INTO organizations(name, parent_id, type, status) VALUES(#{name}, #{parentId}, #{type}, #{status})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    int create(organizations organizations);

    // 移除updatedAt字段的更新操作
    @Update("UPDATE organizations SET name = #{name}, parent_id = #{parentId}, type = #{type}, status = #{status} WHERE id = #{id}")
    int modify(organizations organizations);

}





